

package feesmodule.converter;

import feesmodule.domain.Program;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement
public class ProgramToServiceMapConverter
{

    private int debitIndicator = 0;
    private List<ProgramConverter> programConverters = new ArrayList<ProgramConverter>();

    public ProgramToServiceMapConverter(int debitIndicator)
    {
        this.debitIndicator = debitIndicator;
    }
    
    public ProgramToServiceMapConverter()
    {
    }

    @XmlAttribute(name ="type")
    public int getDebitIndicator()
    {
        return debitIndicator;
    }
    
    public void convertProgram(Program p)
    {
        ProgramConverter converter = new ProgramConverter(p);
        programConverters.add(converter);
    }

    @XmlElement(name="program")
    public Collection<ProgramConverter> getPrograms()
    {
        return programConverters;
    }

    /**
     * @param debitIndicator the debitIndicator to set
     */
    public void setDebitIndicator(int debitIndicator) {
        this.debitIndicator = debitIndicator;
    }
}
